package com.lzh.config;

import com.lzh.webservice.MyWebService;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import javax.xml.ws.Endpoint;

/**
 * cxf 配置
 */
@Configuration
public class CxfConfig {
    @Resource
    private Bus bus;

    @Resource
    private MyWebService myWebService;

    @Bean
    public Endpoint endpoint(){
        EndpointImpl endpoint = new EndpointImpl(bus, myWebService);
        endpoint.publish("/MyWebService");
        return endpoint;
    }

}
